<%@ page import="rcfirewall.conexaoBD"%>
<%@ page import="rcfirewall.verificaIP"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Softpar Firewall</title>
</head>
<body>
<%
String host = request.getParameter("host");
String ipAddress = request.getParameter("ipAddress");
conexaoBD bd = new conexaoBD();

verificaIP ip = new verificaIP();

if (ip.validaIP(ipAddress) == true) {
	bd.insertBD("insert into DESTINATION (name,ip_address) value (\'" + host + "\',\'" + ipAddress + "\')");
	out.println("Host adicionado com Sucesso");
}else{
	out.println("Endereço IP Inválido");
}
%>

</body>
</html>